package org.nobject.common.swing.g;

import java.awt.Container;
import java.awt.Graphics;
import java.awt.event.ActionListener;

import javax.swing.JCheckBox;

/**
 * GCheckBox
 *
 * @author bianrongjun
 * @version 1.0
 */
public class GCheckBox extends JCheckBox implements IG{
	
	/**
	 * 构造函数 
	 */
	public GCheckBox() {
		super();
		this.core=new GComponent();
	}
	
	/**
	 * 构造函数 
	 * @param text
	 */
	public GCheckBox(String text) {
		super(text);
		this.core=new GComponent();
	}
	
	/**
	 * 构造函数 
	 * @param container
	 * @param text
	 */
	public GCheckBox(Container container, String text) {
		super(text);
		this.core=new GComponent();
		if(container!=null) container.add(this);
	}
	
	/**
	 * 构造函数 
	 * @param container
	 * @param text
	 * @param selected
	 * @param actionListener
	 */
	public GCheckBox(Container container, String text,Boolean selected) {
		super(text);
		this.core=new GComponent();
		this.setSelected(selected);
		if(container!=null) container.add(this);
	}
	
	/**
	 * 构造函数 
	 * @param container
	 * @param text
	 * @param selected
	 * @param actionListener
	 */
	public GCheckBox(Container container, String text,Boolean selected,ActionListener actionListener) {
		super(text);
		this.core=new GComponent();
		this.setSelected(selected);
		if(container!=null) container.add(this);
		if(actionListener!=null) this.addActionListener(actionListener);
	}
	
	/**
	 * 构造函数 
	 * @param container
	 * @param text
	 * @param actionListener
	 */
	public GCheckBox(Container container, String text,ActionListener actionListener) {
		super(text);
		this.core=new GComponent();
		if(container!=null) container.add(this);
		if(actionListener!=null) this.addActionListener(actionListener);
	}
	
	/** GComponent */
	private GComponent core;
	public GComponent getGCore() {return core;}
	
	
	public void paintChildren(Graphics g) {core.paintChildren(g);super.paintChildren(g);}
}
